<?php
class NewsController extends CommonController{
	public function index(){
		$db=M('News');
		$where='category_id=1';
		$count=$db->where($where)->count();
		$p=new Page($count);
		$newsList=M('News')->where($where)->limit($p->firstRow.','.$p->listRows)->select();
		$this->assign('page',$p->show());
		$this->assign('newsList',$newsList);
		$this->display();
	}
}